package com.atguigu;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;

import java.io.IOException;

public class Hbase_Connect {
    public static void main(String[] args) throws IOException {

        //设置链接配置
        Configuration conf = new Configuration();
        conf.set("hbase.zookeeper.quorum", "hadoop102,hadoop103,hadoop104");

        //创建链接
        Connection connection = ConnectionFactory.createConnection(conf);

        System.out.println(connection);

        //关闭链接
        connection.close();


    }
}
